<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <link rel="stylesheet" type="text/css" href="./css/aui.css" />
    <link rel="stylesheet" type="text/css" href="./css/style.css" />
    <link rel="stylesheet" type="text/css" href="./css/font-awesome.min.css" />
    <script type="text/javascript" src="./script/jquery.min.js"></script>
</head>

<body>
    <!-- <header class="aui-bar aui-bar-nav header"> -->
    <!-- <a class="aui-pull-left">
        <span class="aui-iconfont aui-icon-left"></span>
    </a> -->

    <footer class="aui-bar aui-bar-tab footer" id="footer">
        <div class="aui-bar-tab-item aui-active" id='I0' onclick="randomSwitchBtn( 0 );" tapmode>
            <i class="fa fa-list-ul"></i>
            <div class="aui-bar-tab-label">分类查询</div>
        </div>
        <div class="aui-bar-tab-item"  id='I1' onclick="randomSwitchBtn( 1 );" tapmode>
            <i class="fa fa-exclamation-circle"></i>
            <div class="aui-bar-tab-label">条件查询</div>
        </div>
        <div class="aui-bar-tab-item" id='I2' onclick="randomSwitchBtn( 2 );" tapmode>
            <i class="fa fa-calendar"></i>
            <div class="aui-bar-tab-label">自定义查询</div>
        </div>
        <!-- <div class="aui-bar-tab-item" id='I3' onclick="randomSwitchBtn( 3 );" tapmode>
            <i class="fa fa-bar-chart"></i>
            <div class="aui-bar-tab-label">相关资料</div>
        </div> -->
        <!-- <div class="aui-bar-tab-item" id='I4' onclick="randomSwitchBtn( 4 );" tapmode>
            <i class="fa fa-line-chart"></i>
            <div class="aui-bar-tab-label">目标考核</div>
        </div> -->
    </footer>


</body>
<script type="text/javascript" src="./script/api.js"></script>

</html>
<script>
    apiready = function() {
        // NVTabBar = api.require('NVTabBar');
        var color = $api.getStorage('color');
        $(".theme").attr("href", color);
        api.addEventListener({
            name: 'keyback'
        }, function(ret, err) {
            api.closeWidget();

        })

        api.openFrame({
            name: 'temp',
            url: './temp.html',
            rect: {
                x: 0,
                y: 0,
                w: 'auto',
                // h: $api.dom('#main').offsetHeight
                marginBottom: 60
            },
        });

    }


    function funIniGroup() {
        api.openFrameGroup({
            name: 'nav',
            background: '#fff',
            scrollEnabled: false,
            rect: {
                x: 0,
                y: 0,
                w: 'auto',
                // h: $api.dom('#main').offsetHeight
                marginBottom: 60
            },
            index: 0,
            frames: [{
                name: 'temp',
                url: './temp.html',
                bgColor: '#fff'
            }, {
                name: 'fangan',
                url: './fangan.html',
                bgColor: '#fff'
            }, {
                name: 'searchnew',
                url: './searchnew.html',
                bgColor: '#fff'
            }, {
                name: 'pdf',
                url: 'file:///storage/emulated/0/pdf/index_1.htm',
                // url: './html/index_1.htm',
                bgColor: '#fff'
            }]
        }, function(ret, err) {});
    }

    function randomSwitchBtn(index) {
      var cl ='#I'+index;
      $('div').removeClass('aui-active');
for (var i = 0; i < 5; i++) {
  if (i==index) {
      $("#I"+index).addClass('aui-active');
  }
}
      var name; var url;
        if (index == 0) {
            name = 'temp';
            url='./temp.html';
        } else if (index == 1) {
          name = 'fangan';
          url='./fangan.html';
        } else if (index == 2) {
          name = 'searchnew';
          url='./searchnew.html';
        }
        //  else if(index == 3) {
        //   name = 'xiangguan';
        //   url='./xiangguan.html';
        // }
        else {
          name = 'kaohe';
          url='./kaohe.html';
        }
            api.closeFrameGroup({
                name: 'classifyGrop'
            });

        api.openFrame({
            name: name,
            url: url,
            rect: {
                x: 0,
                y: 0,
                w: 'auto',
                // h: $api.dom('#main').offsetHeight
                marginBottom: 60
            },
            reload:true
        });
        //-------------------------------
    //     if (index != 0) {
    //         api.closeFrameGroup({
    //             name: 'classifyGrop'
    //         });
    //     }
    //     api.closeFrame({
    //         name: 'classifyimgNew'
    //     });
    //     api.closeFrame({
    //         name: 'fananSearch'
    //     });
    //     api.closeFrame({
    //         name: 'classify-imgSearch'
    //     });
    //
    //     api.setFrameGroupIndex({
    //         name: 'nav',
    //         index: index,
    //         reload: true
    //     });
    }
    //---------------------------------------------------------------------------------------------


    function closePrgress() {
      api.hideProgress();
    }
</script>
